#include <iostream>
using namespace std;

int main(int argc, char const *argv[])
{
    // 使用引用捕获一个外部变量
    int c;
    int a = 100;
    auto lambda = [&a] {
        int result = a + 10;
        return result;
    };
    a = 200;
    c = lambda();
    cout << "a = " << a << ", c = " << c << endl; 
    return 0;
}
